pp108 : Working with the Generic Approval Page

Working with the Generic Approval Page

This topic describes using a Generic Approval Page as a task in your business process.

You can use a Generic Approval Page as a task in your business process. Often, business processes contain one or more steps that involve sending a document or an item for approval.

The Generic Approval Page displays the business identifiers of the process and the options specified in the message map as buttons. It can be used for approving or rejecting a task and any other action specified as options. This approval page is included in the Process Platform HTML5 SDK application; after installing the application, it can be used as a task in any process.

To use a generic approval page in your business process, do the following:

  1. Create an external user interface referring the approval page. The URL of the approval task page must be /<instance>/html5/demo/approvetask.htm. For more information on creating an external user interface, refer to Creating a User Interface Using a Web Page URL. Use the following input and output schema definitions:
    Input Schema
    <xsd:schema elementFormDefault="qualified"
        targetNamespace="http://schemas.cordys.com/" xmlns=""
        xmlns:tns="http://schemas.cordys.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <element name="ApproveTask" xmlns="http://www.w3.org/2001/XMLSchema">
            <complexType>
                <sequence>
                    <element name="header" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
                    <element name="options" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
                </sequence>
            </complexType>
        </element>
    </xsd:schema>
    
    Output Schema
    <schema attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        targetNamespace="http://schemas.cordys.com/approve"
        xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.cordys.com/approve">
        <element name="ApproveTask_ApproveTaskDefaultDeliveryModel_OP" xmlns="http://www.w3.org/2001/XMLSchema">
            <complexType>
                <sequence>
                    <element name="response" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
                    <element name="comment" type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
                </sequence>
            </complexType>
        </element>
    </schema>
    
  2. Define the business identifiers for the business process. These business identifiers will be displayed in the approval page.
  3. Specify the header and options (approve or reject) in the message map.
  4. You can check the response, which will be the value of one of the options, and the provided comment.

Example

The following example describes a sample order approval process:

  1. The required business identifiers are defined in this example as Customer, Product, Quantity, Cost, and Discount. For more information on creating a business identifier, refer to Creating a Business Identifier.
  2. Assign values to the business identifiers in the message map after the Start activity. For more information on message maps, refer to Using Message Maps.
  3. In the message map, specify the header and options in the Approval activity. The s ample XML structure to be mapped for Options can be as follows:
    <options>
        <option label="Approve" value="approve"/>
        <option label="Reject" value="reject"/>
    </options>
    
  4. Specify the message map with the response and comments after the Approval activity.
  5. Execute the business process.
  6. During run-time, the Task Approval Page is displayed as follows:

If there are any attachments to the Task Approval page, they are displayed in the form of links as follows:

The Generic Approval page is created and used in the business process.

Attachments: